var obj = JSON.parse(localStorage.getItem('detial'))
var tupian = document.querySelector('#sDetail>img')
var biaoti = document.querySelector('#sDetail .sDetailRight h2')
var jiage = document.querySelector('#sDetail .sDetailRight h3 span')
var gouwu = document.querySelector('#sDetail .sDetailRight button')
if (obj) {
    biaoti.innerHTML = obj.title
    jiage.innerHTML = obj.price
    tupian.src = obj.img_src
}



gouwu.onclick = function () {
    var arr = JSON.parse(localStorage.getItem('buyCar')) || []
    arr.push(obj)
    localStorage.setItem('buyCar', JSON.stringify(arr))
}
